package io.mft.commons.db.mapper;

import java.util.List;

import io.mft.commons.function.response.kv.KVMap;
import io.mft.commons.util.CommonUtil;

public class Pager {
	private int currentPage;
	private int numPerPage;
	private List<KVMap> dataList;
	public Pager(int currentPage,int numPerPage) {
		this.numPerPage=numPerPage;
		this.currentPage=currentPage;
	}
	public int getCurrentPage() {
		return currentPage;
	}
	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}
	public int getNumPerPage() {
		return numPerPage;
	}
	public void setNumPerPage(int numPerPage) {
		this.numPerPage = numPerPage;
	}
	
	public List<KVMap> getDataList() {
		return dataList;
	}
	public void setDataList(List<KVMap> dataList) {
		this.dataList = dataList;
	}
	
	 public <T> List<T>  dataObjectList(Class<T> classType) {
		return CommonUtil.convertToObj(getDataList(), classType);
	}
}
